#include "BridgeEntity2.h"




BridgeEntity2::BridgeEntity2(int id, int type, double x, double y)
{
	_data = new BridgeData2(id, type, x, y);
	Rect* rect = _data->getRect();
	leftFire = new FireEntity(-1, _ID_MAP_STAGE2_FIRE, rect->getLeft() + rect->Width/4, rect->getTop(), rect); 
	leftFire->swapV();
	rightFire = new FireEntity(-1, _ID_MAP_STAGE2_FIRE, rect->getRight() - rect->Width/4, rect->getTop(), rect); 
	_data->subRect->push_back(leftFire->getAbstractData()->getRect());
	_data->subRect->push_back(rightFire->getAbstractData()->getRect());
}

void BridgeEntity2::update(long time)
{
	_data->sprites->updateCurrent();
	leftFire->update(time);
	rightFire->update(time);
}

void BridgeEntity2::draw(long time)
{
	_data->sprites->draw();
	leftFire->draw(time);
	rightFire->draw(time);
}

AbstractData* BridgeEntity2::getAbstractData()
{
	return _data;
}

BridgeEntity2::~BridgeEntity2()
{

}
